package com.jboost.hyk.common.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.jboost.common.constant.CommonConstant;
import com.jboost.hyk.common.constant.SchoolGradeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;

/**
 * @Description: 学员表
 * @Author: jeecg-boot
 * @Date:   2022-10-10
 * @Version: V1.0
 */
@Data
@TableName("hyk_member")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="hyk_member对象", description="学员表")
public class HykMember {

    /**主键id*/
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键id")
    private java.lang.String id;

    /**学员账号id*/
    @ApiModelProperty(value = "学员账号id")
    private java.lang.String accountId;

    @TableField(exist = false)
    /**
     * 学员对应账号的账号名，做冗余而已
     */
    private java.lang.String accountName;
    /**名字*/
    @Excel(name = "名字", width = 15)
    @ApiModelProperty(value = "名字")
    private java.lang.String name;
    /**头像*/
    @Excel(name = "头像", width = 15)
    @ApiModelProperty(value = "头像")
    private java.lang.String headPortrait;
    /**头像*/
    @Excel(name = "头像文件id", width = 15)
    @ApiModelProperty(value = "头像文件id")
    private java.lang.String headPortraitFileId;
    /**年纪*/
    @Excel(name = "年纪", width = 15)
    @ApiModelProperty(value = "年纪")
    private java.lang.Integer age;
    /**性别*/
    @Excel(name = "性别", width = 15)
    @ApiModelProperty(value = "性别")
    private java.lang.String sex;

    /**性别*/
    @Excel(name = "联系电话", width = 15)
    @ApiModelProperty(value = "联系电话")
    private java.lang.String contactPhone;
    /**组织id*/
    @Excel(name = "组织id", width = 15)
    @ApiModelProperty(value = "组织id")
    private java.lang.String businessId;
    /**年纪*/
    @Excel(name = "年级", width = 15)
    @ApiModelProperty(value = "年级")
    private java.lang.String grade;
    /**年*/
    @Excel(name = "年", width = 15)
    @ApiModelProperty(value = "年")
    private java.lang.Integer year;
    /**月*/
    @Excel(name = "月", width = 15)
    @ApiModelProperty(value = "月")
    private java.lang.Integer month;
    /**日*/
    @Excel(name = "日", width = 15)
    @ApiModelProperty(value = "日")
    private java.lang.Integer day;
    /**学校*/
    @Excel(name = "学校", width = 15)
    @ApiModelProperty(value = "学校")
    private java.lang.String school;
    /**家庭住址*/
    @Excel(name = "家庭住址", width = 15)
    @ApiModelProperty(value = "家庭住址")
    private java.lang.String address;

    /**家长电话：[{“parentId": "132334677789890", "parentName": "爸爸", "phone": "13800138000" }]*/
    @ApiModelProperty(value = "家长电话：[{\"parentId\":\"132334677789890\",\"parentName\": \"爸爸\", \"phone\": \"13800138000\" }]")
    private java.lang.String parentPhone;

    /**类型 1 学员 2 老师 */
    @Excel(name = "类型 1 学员 2 老师 ", width = 15)
    @ApiModelProperty(value = "类型 1 学员 2 老师 ")
    private java.lang.Integer type;
    /**极光推送id*/
    @Excel(name = "极光推送id", width = 64)
    @ApiModelProperty(value = "极光推送id")
    private java.lang.String registrationId;

    /**0 未删除 1 删除*/
    @Excel(name = "0 未删除 1 删除", width = 15)
    @ApiModelProperty(value = "0 未删除 1 删除")
    @TableLogic
    private java.lang.Integer delFlag;

    /**状态 0 正常*/
    @Excel(name = "状态 0 正常", width = 15)
    @ApiModelProperty(value = "状态 0-新建；1-开通、正常；2-关闭；")
    private java.lang.Integer status;

    /**学员状态：reading-在读中、completed-已结课、none-无课*/
    @ApiModelProperty(value = "学习状态：reading-在读中、completed-已结课、none-无课")
    private java.lang.String learningStatus;

    /**描述及备注*/
    @Excel(name = "描述及备注", width = 15)
    @ApiModelProperty(value = "描述及备注")
    private java.lang.String description;
    /**创建时间*/
    @ApiModelProperty(value = "创建时间")
    private java.util.Date createTime;
    /**createBy*/
    @Excel(name = "createBy", width = 15)
    @ApiModelProperty(value = "createBy")
    private java.lang.String createBy;
    /**更新时间*/
    @ApiModelProperty(value = "更新时间")
    private java.util.Date updateTime;
    /**updateBy*/
    @Excel(name = "updateBy", width = 15)
    @ApiModelProperty(value = "updateBy")
    private java.lang.String updateBy;

    public Integer parseGradeCode(){
        if(null == grade){
            return -1;
        }
        return SchoolGradeEnum.getCodeByDesc(grade);
    }
}
